$(function () {
    //鼠标移入放大效果  
    //大图
    $("section>.article1>.article1Img").mouseenter(function () {
        $(this).find("img").css({
            width: "274px",
            height: "300px",
            position: "absolute",
            top: "-20px",
            left: "-20px"
        });
    }).mouseleave(function () {
        $(this).find("img").css({
            width: "224px",
            height: "250px",
            position: "absolute",
            top: "0px",
            left: "0px"
        });
    })
    //小图 给a标签添加鼠标移入事件
    $(".article1>.article1List>ul>li>a").mouseenter(function () {
        console.log(11);
        $(this).find("img").css({
            width: "130px",
            height: "130px",
            position: "absolute",
            top: "-10px",
            left: "-10px"
        });
    }).mouseleave(function () {
        timer = setInterval(autoPlay, 1500);
        $(this).find("img").css({
            width: "120px",
            height: "120px",
            position: "absolute",
            top: "0px",
            left: "0px"
        });
    })
    //小图的左右点击
    $(".article1>.article1List>ul>.next").click(function () {
        console.log(11111111111);
        $(this).css("display", "none");
        $(this).parent("ul").animate({
            left: "-736px",
        }, 1000, () => {
            $(this).prev("span").css("display", "block");
        });
    })
    $(".article1>.article1List>ul>.prev").click(function () {
        $(this).css("display", "none");
        $(this).parent("ul").animate({
            left: "0px",
        }, 1000, () => {
            $(this).next("span").css("display", "block");
        });
    })


    //article2
    //轮播图2（进度条）无缝轮播
    //克隆
    $(".Img>ul>li:eq(0)").clone(true).appendTo(".Img>ul");
    //自动轮播
    var imgIndex = 0;
    var dianIndex = 0;

    function autoPlay() {

        imgIndex++;

        if (imgIndex == 4) {
            $(".Img ul").css({
                left: 0
            });
            imgIndex = 1;
        }

        $(".Img ul").animate({
            left: -imgIndex * 305
        }, 500)

        $(".article2 .article2Left .article2LeftPlay>li>span").eq(dianIndex).animate({
            width: 55
        }, 2000, () => {
            $(".article2 .article2Left .article2LeftPlay>li>span").css("width", 0);
        })

        dianIndex++;
        if (dianIndex == 3) {
            dianIndex = 0;
        }
        // $("ol>li").eq(dianIndex).addClass("current").siblings().removeClass();
    }
    var timer = setInterval(autoPlay, 2000, () => {
        $(".article2 .article2Left .article2LeftPlay>li>span").eq(dianIndex).animate({
            width: 55
        }, 2000)
    });
    $(".article2 .article2Left").mouseenter(function () {
        console.log(222222222);
        clearInterval(timer);
        // $(this).find("img").eq(imgIndex).css({
        //     width: "320px",
        //     height: "380px",
        //     position: "absolute",
        //     top: "-10px",
        //     left: "-10px"
        // })
    }).mouseleave(function () {
        imgIndex=dianIndex-1;
        timer = setInterval(autoPlay, 2000, () => {
            $(".article2 .article2Left .article2LeftPlay>li>span").eq(imgIndex - 1).animate({
                width: 55
            }, 2000)
        });
        // $(this).find("img").eq(imgIndex).css({
        //     width: "305px",
        //     height: "370px",
        //     position: "absolute",
        //     top: "0px",
        //     left: "0px"
        // })
    })
    //左边轮播
    $(".article2 .article2Right>a").mouseenter(function () {
        $(this).find("img").css({
            width: "120%",
            position: "absolute",
            top: "-10px",
            left: "-10px"
        })
    }).mouseleave(function () {
        $(this).find("img").css({
            width: "100%",
            position: "absolute",
            top: "0px",
            left: "0px"
        })
    })

    //给fixed的分类栏添加鼠标移入事件



})